import store from '../store'
export function toast(msg, type) {
    // 判断成功，失败，警告的图标显示
    switch (type) {
        case 'denger':
            type = 'icon-toast-shibai_huaban'
            break;
        case 'warning':
            type = 'icon-toast-jinggao'
            break;
        default:
            type = 'icon-toast_chenggong'
    }
    store.commit('showToast', { msg, type })
    setTimeout(() => {
        store.commit('hideToast')
    }, 1500)
}